﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Push Notification</title>
<meta name="GENERATOR" content="WinCHM">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

</head>

<body>
<P><A 
href="http://vietgamedev.net/blog/30/android-push-notification-c2dm-part1/"><FONT 
face=Courier>http://vietgamedev.net/blog/30/android-push-notification-c2dm-part1/</FONT></A><FONT 
face=Courier> </FONT></P>
<P><FONT face=Courier>nó phát đi một yêu cầu đăng ký tới máy chủ C2DM</FONT></P>
<P><FONT face=Courier>Intent registrationIntent = 
newIntent("com.google.android.c2dm.intent.REGISTER");registrationIntent.putExtra("app",PendingIntent.getBroadcast(this, 
0, newIntent(), 0));registrationIntent.putExtra("sender", 
emailOfSender);startService(registrationIntent);<BR>&nbsp;<BR><BR>Đăng ký 1 account với dịch vụ C2DM&nbsp;tại :&nbsp; 
<BR> 
       
  </FONT><A 
href="http://code.google.com/intl/hu-HU/android/c2dm/signup.html"><FONT 
face=Courier>http://code.google.com/intl/hu-HU/android/c2dm/signup.html</FONT></A><BR><A 
href="https://developers.google.com/android/c2dm/index?hl=hu-HU#registering"><FONT 
face=Courier>https://developers.google.com/android/c2dm/index?hl=hu-HU#registering</FONT></A><BR></P>
<P>How the Application Server Sends Messages</P>
<P><A 
href="http://www.vogella.com/articles/AndroidCloudToDeviceMessaging/article.html#c2dm_sendmessage">http://www.vogella.com/articles/AndroidCloudToDeviceMessaging/article.html#c2dm_sendmessage</A></P>
<P><STRONG><FONT face=Courier color=#800000 
size=5>----------------------------------------<BR></FONT></STRONG><FONT face=Courier><FONT 
color=#800000 size=5><STRONG><FONT style="BACKGROUND-COLOR: #ffff00">Chứng thực gmail :&nbsp;<BR></FONT><FONT color=#000000 size=3>băng 
lệnh trong LINUX</FONT>        
</STRONG></FONT>     
<BR> </FONT></P>
<P>curl <A 
href="https://www.google.com/accounts/ClientLogin">https://www.google.com/accounts/ClientLogin</A> 
-d <A href="mailto:Email=phucf8@gmail.com">Email=phucf8@gmail.com</A> -d 
Passwd=matrix1382 -d accountType=GOOGLE -d source=Google-cURL-Example -d 
service=ac2dm</P>
<P>curl <A 
href="https://www.google.com/accounts/ClientLogin">https://www.google.com/accounts/ClientLogin</A> 
-d <A 
href="mailto:Email=jitvn.android@gmail.com">Email=jitvn.android@gmail.com</A> -d 
Passwd=jit.vn290985 -d accountType=GOOGLE -d source=Google-cURL-Example -d 
service=ac2dm</P>
<P>SID=DQAAALUAAAAlIGr_YbTZCj8nYELCaoILa6QNQc8Chu-ig9bbgEmmNE65hZsnObiwkuYOQdZATXMWkIYaSF02uJmeXLnpwUxKQLB6PPjxGmYeTqOAIEMar6ic59sSZW5WLHqbNOsnG_Tm7L6OIjjv7VpZaFH_EIFI2Cyt8jJhrjUM5WxwnJMQgv8Sd0tU_kBn9fHqcg6T86d3Wchl5nv0DSgd2FIshttxWumGpN4LzYgIxvyilVFxQwFGNqlRRnpqyQOhz2ZTSrcLSID=DQAAALYAAABd8sAJnkCvP5AZOc7UpWqYJm0Dhz0tc5Jiks3NlWG6N8ufxb_lmMIkaoKuq17OJi329zCRV0bHQrjwYL2GC3dlmHNVNP8QicMf8fqlO2vDT_T7VtUNUyW5e66Rv_0mOD3x08kK-BVPhBl7JaQmIjUE9rXs3n59GlZ3kozwm_-HoDCC-6wDX2gqmT7AYalH2TcmikmksfCGwAv-wMZuPW-NbOMUrZxMz2eqeMMOME8ScPchv-31cG6EY0ni5-VZAlQ 
<FONT 
color=#ff0000>Auth=DQAAALcAAAAjIbpmUcGLirx663wPKXngSOQCBJnmIE0QEcNlPzvTnaJLqU6V44HiTaVNajAfls568S4bF15Ab7kfCvn8wtn5uKatHZGYKaz-2rKYAJftmPWYqRRSHhNwRzvlhsyKe2lTceZXtdhngdq_c-iKnZWfThNYZTtuG1pYd531RSVLggNm6WKbnvw0Z5k0PegB19sats0qBlHx-ZmV3nZr_M8Z3N0dE48TwCzS3LjttC1wMvq552UIuF_XugEF8VVNk4Y</FONT></P>
<P><FONT face=Courier color=#000000 ><STRONG> bạn cũng có thể chứng thực gmail&nbsp;bằng 
code<BR></STRONG>cụ thể là send request <A 
href="https://www.google.com/accounts/ClientLogin?Email=jitvn.android@gmail.com&amp;Passwd=jit.vn290985"><FONT 
face="Times New Roman">https://www.google.com/accounts/ClientLogin?Email=jitvn.android@gmail.com&amp;Passwd=jit.vn290985</FONT></A><BR>có thể dùng http request, vướng mắc có thể tham khảo tại : 
<A href="http://www.exampledepot.com/egs/java.net/GetHeaders.html"><FONT 
face="Times New Roman">http://www.exampledepot.com/egs/java.net/GetHeaders.html</FONT></A> 
      
    </FONT></P>
<P><FONT face=Courier color=#800000 size=5><STRONG>----------------------------------------<BR></STRONG> 
    </FONT><FONT face=Courier color=#800000 size=5><STRONG>Android Push Notification Demo<BR></STRONG><FONT 
color=#000000 size=3>D:\PhucJava\push\push<BR>registration_id=<FONT 
color=#ff0000>APA91bFneBS65_IaqbZpj2FcTIWJ69egPr1R6FLqiYA1MRF129FaaW77gRS2k64CdakTRt5YMQgj--vcFaKJ-ttMCbwqhxxY_L-NZXAZlt7mN9tXkhKY5DmejYnAXD1GeQv6OZtNgdWOjo2wockD6nb4_nmTLM_8Cw</FONT></FONT> 
    </FONT></P>
<P><FONT face=Courier color=#800000 size=5><STRONG>----------------------------------------<BR></STRONG> 
    </FONT><FONT face=Courier color=#800000 size=5><STRONG>How the Application Server Sends Messages<BR></STRONG> 
    </FONT><FONT face=Courier color=#800000 size=5><FONT 
color=#000000 size=3><STRONG>Dùng lệnh trong LINUX : <BR></STRONG>curl --header "Authorization: GoogleLogin auth=                                                           <FONT 
color=  #ff0000> ..." "<A 
href="https://android.apis.google.com/c2dm/send">https://android.apis.google.com/c2dm/send</A>"<FONT color=#000000>-d registration_id= ... -d 
"data.payload=   
  message_here"&nbsp;-d   
collapse_key= 
 
chuoituyy 
   
</FONT> 
    </FONT></FONT></FONT></P>
<P><FONT face=Courier ><FONT 
> <STRONG><FONT color=#800000 
size=5>----------------------------------------<BR></FONT></STRONG><FONT face=Courier color=#800000 size=5><STRONG>Vấn&nbsp;đề gặp phải 
:&nbsp;Unauthorized</STRONG>&nbsp;<BR> 
    </FONT></FONT></FONT><FONT face=Courier color=#800000 size=5><FONT 
color=#000000 size=3>&lt;HTML&gt;<BR>&lt;HEAD&gt;<BR>&lt;TITLE&gt;Unauthorized&lt;/TITLE&gt;<BR>&lt;/HEAD&gt;<BR>&lt;BODY 
BGCOLOR="#FFFFFF" 
TEXT="#000000"&gt;<BR>&lt;H1&gt;Unauthorized&lt;/H1&gt;<BR>&lt;H2&gt;Error 
401&lt;/H2&gt;<BR>&lt;/BODY&gt;<BR>&lt;/HTML&gt;<BR><STRONG><FONT color=#800000 
size=5>----------------------------------------<BR></FONT></STRONG><FONT face=Courier > <FONT size=5><FONT color=#800000><STRONG>tự động hóa toàn 
bộ quá trình bằng code 
java</STRONG></FONT></FONT> 
    </FONT></P></FONT></FONT></body>
</html>
